<template>
  <div>
    <BasicTable @register="registerTable" :searchInfo="searchInfo"></BasicTable>
  </div>
</template>
<script lang="ts" setup name="companyBalancelog">
import { BasicTable } from '@apps/antd-admin/src/components/Table';
import { useDrawer } from '@apps/antd-admin/src/components/drawer';
import { useBaseTable } from '@apps/antd-admin/src/hooks';

import { columns, searchFormSchema } from './data/data';
import { Api } from './data/api';
import { reactive } from 'vue';

const [registerDrawer, { openDrawer }] = useDrawer();
const { prefixCls, tableContext, handleDelete, handleSuccess, handlePost, handleBatchDelete } = useBaseTable({
  designScope: 'companyBalancelog-template',
  tableProps: {
    //表格标题
    title: '企业余额日志',
    //主键字段
    rowKey: 'companyBalancelogId',
    //列表接口
    listUrl: Api.page,
    //删除接口
    delUrl: Api.remove,
    //列定义
    columns,
    //查询表单配置
    formConfig: {
      labelWidth: 120,
      schemas: searchFormSchema,
    },
    showActionColumn: false,
  },
});

const [registerTable, { reload }, { rowSelection, hasSelectedRows }] = tableContext;
const searchInfo = reactive<Recordable>({});

function setSearchInfoProps(companyId) {
  console.info('companyId', companyId);
  searchInfo.companyBalanceId = companyId;
}

defineExpose({
  setSearchInfoProps,
});
</script>
